<html>
<head><meta charset="utf-8"><title>sync 2019-04-09 · t-compiler/wg-rfc-2229 · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/index.html">t-compiler/wg-rfc-2229</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html">sync 2019-04-09</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="162934554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162934554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162934554">(Apr 09 2019 at 18:03)</a>:</h4>
<p>Hey all <span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span></p>



<a name="162934600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162934600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162934600">(Apr 09 2019 at 18:04)</a>:</h4>
<p>cc <span class="user-group-mention" data-user-group-id="1175">@WG-rfc-2229</span></p>



<a name="162934635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162934635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162934635">(Apr 09 2019 at 18:04)</a>:</h4>
<p>hello</p>



<a name="162934676"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162934676" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162934676">(Apr 09 2019 at 18:05)</a>:</h4>
<p>I didn't do anything since last time except hang out at a cabin on Punta del Diablo</p>



<a name="162934721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162934721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162934721">(Apr 09 2019 at 18:05)</a>:</h4>
<p>Hopefully some good food :D</p>



<a name="162934725"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162934725" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162934725">(Apr 09 2019 at 18:05)</a>:</h4>
<p>but I was just starting to go through <span class="user-mention" data-user-id="116773">@csmoe</span>'s list of free variables</p>



<a name="162934735"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162934735" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162934735">(Apr 09 2019 at 18:05)</a>:</h4>
<p>I won't be able to make it to the meeting today. Sorry guys</p>



<a name="162934738"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162934738" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162934738">(Apr 09 2019 at 18:05)</a>:</h4>
<blockquote>
<p>Hopefully some good food :D</p>
</blockquote>
<p>well, it's not so veggie friendly there, but we ate well :)</p>



<a name="162934840"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162934840" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162934840">(Apr 09 2019 at 18:06)</a>:</h4>
<p>I will read it async, if Niko can drive it today ?</p>



<a name="162935804"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162935804" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162935804">(Apr 09 2019 at 18:17)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> any input on <a href="https://paper.dropbox.com/doc/Upvar-Paths--Aa7C6aefXL6RNSXHuUu8jncVAg-PNRgk22ryKq1n3Wq3FXAO" target="_blank" title="https://paper.dropbox.com/doc/Upvar-Paths--Aa7C6aefXL6RNSXHuUu8jncVAg-PNRgk22ryKq1n3Wq3FXAO">https://paper.dropbox.com/doc/Upvar-Paths--Aa7C6aefXL6RNSXHuUu8jncVAg-PNRgk22ryKq1n3Wq3FXAO</a> would be most appreciated, fwiw</p>



<a name="162935828"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162935828" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162935828">(Apr 09 2019 at 18:17)</a>:</h4>
<p>OK. Sorry, I was supposed to drive, but there is a contractor here and they pulled me away from sething</p>



<a name="162935832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162935832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162935832">(Apr 09 2019 at 18:17)</a>:</h4>
<p>back now</p>



<a name="162935882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162935882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162935882">(Apr 09 2019 at 18:18)</a>:</h4>
<p>np :-)</p>



<a name="162935891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162935891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162935891">(Apr 09 2019 at 18:18)</a>:</h4>
<p>I'll take a look at this</p>



<a name="162935900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162935900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162935900">(Apr 09 2019 at 18:18)</a>:</h4>
<p>the upvar paths proposal</p>



<a name="162935902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162935902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162935902">(Apr 09 2019 at 18:18)</a>:</h4>
<p>let me just do that now</p>



<a name="162935929"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162935929" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162935929">(Apr 09 2019 at 18:18)</a>:</h4>
<p>cool</p>



<a name="162935983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162935983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162935983">(Apr 09 2019 at 18:19)</a>:</h4>
<p><span class="user-mention" data-user-id="127677">@ange</span> I'll just leave some comments in the dropbox paper</p>



<a name="162935986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162935986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162935986">(Apr 09 2019 at 18:19)</a>:</h4>
<p>mostly requests for clarification :)</p>



<a name="162936008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936008">(Apr 09 2019 at 18:19)</a>:</h4>
<p>sure</p>



<a name="162936241"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936241" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936241">(Apr 09 2019 at 18:21)</a>:</h4>
<p>fwiw, I'm mostly concerned about the MIR borrow checker ramifications, as I guess I'll need to spend some time on it to get a handle on the bigger picture</p>



<a name="162936345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936345">(Apr 09 2019 at 18:22)</a>:</h4>
<p>i.e. whether temporaries are (a) needed (b) a good idea</p>



<a name="162936421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936421">(Apr 09 2019 at 18:23)</a>:</h4>
<p><span class="user-mention" data-user-id="127677">@ange</span> one question I have</p>



<a name="162936426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936426">(Apr 09 2019 at 18:23)</a>:</h4>
<p>in the branch you have</p>



<a name="162936489"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936489" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936489">(Apr 09 2019 at 18:24)</a>:</h4>
<p>is there some kind of "output" -- i.e., I'm trying to figure out what information we can glean before we go through all the work of changing codegen</p>



<a name="162936500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936500">(Apr 09 2019 at 18:24)</a>:</h4>
<p>I guess I'd be interested to have a list of closures and, for each one, the set of paths that wind up being computed</p>



<a name="162936502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936502">(Apr 09 2019 at 18:24)</a>:</h4>
<p>umm, yah, see <a href="https://github.com/aoikonomopoulos/rust/commit/04ec3f7ced8d8f2bdeade78c4574515f917536a7" target="_blank" title="https://github.com/aoikonomopoulos/rust/commit/04ec3f7ced8d8f2bdeade78c4574515f917536a7">https://github.com/aoikonomopoulos/rust/commit/04ec3f7ced8d8f2bdeade78c4574515f917536a7</a></p>



<a name="162936517"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936517" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936517">(Apr 09 2019 at 18:24)</a>:</h4>
<p>ok, I see</p>



<a name="162936520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936520">(Apr 09 2019 at 18:24)</a>:</h4>
<p>though I haven't posted examples</p>



<a name="162936554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936554">(Apr 09 2019 at 18:25)</a>:</h4>
<p>yeah, so, probably a good thing to do (as a start)</p>



<a name="162936562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936562">(Apr 09 2019 at 18:25)</a>:</h4>
<p>would be to come up with a good list of tricky examples</p>



<a name="162936566"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936566" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936566">(Apr 09 2019 at 18:25)</a>:</h4>
<p>basically try to write-up interesting test cases</p>



<a name="162936575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936575">(Apr 09 2019 at 18:25)</a>:</h4>
<p>this is useful no matter what we do</p>



<a name="162936585"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936585" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936585">(Apr 09 2019 at 18:25)</a>:</h4>
<p>(and probably should be added to the roadmap as a work item)</p>



<a name="162936669"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936669" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936669">(Apr 09 2019 at 18:26)</a>:</h4>
<p>my current ideas are in the <a href="https://github.com/aoikonomopoulos/rust/commit/04ec3f7ced8d8f2bdeade78c4574515f917536a7" target="_blank" title="https://github.com/aoikonomopoulos/rust/commit/04ec3f7ced8d8f2bdeade78c4574515f917536a7">testing section</a></p>



<a name="162936708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936708">(Apr 09 2019 at 18:26)</a>:</h4>
<p>I'm more worried about getting things so wrong that I'd have to start over, which is why I'm more concerned with getting an end-to-end example working first</p>



<a name="162936772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936772">(Apr 09 2019 at 18:27)</a>:</h4>
<p>i.e. get a very simple example of capturing a field sorta working</p>



<a name="162936868"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936868" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936868">(Apr 09 2019 at 18:28)</a>:</h4>
<p>ok, I added test cases to the roadmap, I think it's roughly the same as what you had</p>



<a name="162936874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936874">(Apr 09 2019 at 18:28)</a>:</h4>
<p>I'd feel more comfortable building on something that is unlikely to be swept away by reality</p>



<a name="162936882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936882">(Apr 09 2019 at 18:28)</a>:</h4>
<p>great</p>



<a name="162936888"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936888" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936888">(Apr 09 2019 at 18:28)</a>:</h4>
<p>I just thikn it'd be good to be creating the <code>.rs</code> files</p>



<a name="162936897"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936897" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936897">(Apr 09 2019 at 18:28)</a>:</h4>
<p>we don't have to make them work yet :)</p>



<a name="162936906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936906">(Apr 09 2019 at 18:28)</a>:</h4>
<p>anyway, I guess I will have to review your code in a bit more depth</p>



<a name="162936943"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936943" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936943">(Apr 09 2019 at 18:29)</a>:</h4>
<p>I agree that convering the MIR will be some work</p>



<a name="162936953"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936953" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936953">(Apr 09 2019 at 18:29)</a>:</h4>
<p>it may not be <em>that</em> bad</p>



<a name="162936954"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936954" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936954">(Apr 09 2019 at 18:29)</a>:</h4>
<p>at my level of understanding of the rustc internals, I would be relying on the debug output to verify I'm exercising the path I think I'm exercising in a testcase :-)</p>



<a name="162936961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936961">(Apr 09 2019 at 18:29)</a>:</h4>
<p>a lot of that, I think, is diagnostics ..</p>



<a name="162936977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936977">(Apr 09 2019 at 18:29)</a>:</h4>
<p>would temporaries be at all applicable?</p>



<a name="162936981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162936981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162936981">(Apr 09 2019 at 18:29)</a>:</h4>
<p>basically what happens there is that when you access (e.g.) the upvar <code>x</code> in MIR, it gets converted to <code>this.foo</code></p>



<a name="162937077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162937077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162937077">(Apr 09 2019 at 18:30)</a>:</h4>
<p>i.e. for capturing <code>x.y</code>, do</p>
<div class="codehilite"><pre><span></span>let t1 = &amp;x.y;
env.0 = t1;
</pre></div>



<a name="162937132"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162937132" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162937132">(Apr 09 2019 at 18:31)</a>:</h4>
<p>well I meant more from the inside of the closure</p>



<a name="162937136"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162937136" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162937136">(Apr 09 2019 at 18:31)</a>:</h4>
<p>but that's also true :)</p>



<a name="162937144"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162937144" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162937144">(Apr 09 2019 at 18:31)</a>:</h4>
<p>so I guess we will need to think about how to generalize that</p>



<a name="162937149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162937149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162937149">(Apr 09 2019 at 18:31)</a>:</h4>
<p>so that instead of intercepting at the <em>upvar</em>, we intercept at the full captured path</p>



<a name="162937159"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162937159" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162937159">(Apr 09 2019 at 18:31)</a>:</h4>
<p>that's gonna be the tricky bit</p>



<a name="162937163"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162937163" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162937163">(Apr 09 2019 at 18:31)</a>:</h4>
<p>right. what currently concerns me for the inside of the closure is rewriting the access to trim the path</p>



<a name="162937255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162937255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162937255">(Apr 09 2019 at 18:32)</a>:</h4>
<blockquote>
<p>well I meant more from the inside of the closure</p>
</blockquote>
<p>well, if it means we might not have to touch 200+ upvar references...</p>



<a name="162937342"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162937342" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162937342">(Apr 09 2019 at 18:33)</a>:</h4>
<p>to be clear, that's the reason I'm asking about temporaries. would they be at all viable?</p>



<a name="162945629"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162945629" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162945629">(Apr 09 2019 at 20:10)</a>:</h4>
<p><span class="user-mention" data-user-id="127677">@ange</span> sorry, how would temporaries help exactly?</p>



<a name="162945875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162945875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162945875">(Apr 09 2019 at 20:14)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> well, if you could have one upvar for each captured variable/field, perhaps consumers of upvars would not need to be updated (or at least, not as many consumers would)</p>



<a name="162946521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162946521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162946521">(Apr 09 2019 at 20:23)</a>:</h4>
<p>The challenge I think is that right now an upvar always maps 1-to-1 with some user variable and we're going to have to change that assumption. In any case, I'm feeling a bit unsure about what the concrete steps ought to be to move forward with this refactoring. I think there may be value though in trying to land code that just <em>figures out</em> which paths should be captured, even if we haven't plumbed that all the way through -- particularly if you're going to have to stop working on this at some point (didn't you mention <span class="user-mention" data-user-id="127677">@ange</span> that you might run out of time?)</p>



<a name="162946537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162946537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162946537">(Apr 09 2019 at 20:23)</a>:</h4>
<p>but maybe it makes sense to wait and only land code when we have something end-to-end working</p>



<a name="162947261"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162947261" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162947261">(Apr 09 2019 at 20:32)</a>:</h4>
<p>I expect I can get a decent-looking PR ready that just dumps the capture paths when requested (what's missing is testcases I guess). personally, I wouldn't feel comfortable submitting it for inclusion ATM though, as I'm not even sure the <code>cmt_</code>-based code will be enough (and might need to be significantly rewritten)</p>



<a name="162947314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162947314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162947314">(Apr 09 2019 at 20:33)</a>:</h4>
<p>in any case, I can try to always have some mergeable branch on github</p>



<a name="162947417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162947417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162947417">(Apr 09 2019 at 20:34)</a>:</h4>
<p>ATM I'm more worried about work going to waste because the approach might prove to be a dead end</p>



<a name="162947486"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162947486" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162947486">(Apr 09 2019 at 20:35)</a>:</h4>
<p>which is why I'm mostly trying to look ahead to the end-to-end functionality</p>



<a name="162947607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162947607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162947607">(Apr 09 2019 at 20:36)</a>:</h4>
<p>I guess I'll try to investigate it myself and see where I get ¯\_(ツ)_/¯</p>



<a name="162947675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/162947675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#162947675">(Apr 09 2019 at 20:37)</a>:</h4>
<p>any and all input is more than welcome of course</p>



<a name="163025672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/163025672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#163025672">(Apr 10 2019 at 17:27)</a>:</h4>
<p>OK, so: the MIR borrow checker adjustments don't seem too bad after all. Things would be easier if <code>UpvarId</code> contained the path too, but non-invasive way to do it introduces lots of cloning (as <code>UpvarId</code> is <code>Copy</code>).</p>
<p>Alternatively, we could try making <code>UpvarId</code> an index and hold the non-<code>Copy</code> Upvar (which also contains the path) in a table</p>



<a name="163025755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/163025755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#163025755">(Apr 10 2019 at 17:28)</a>:</h4>
<p>I'm guessing all this cloning is an antipattern for rustc, even if the number of upvars is likely to be small in practice</p>



<a name="163025868"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/163025868" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#163025868">(Apr 10 2019 at 17:29)</a>:</h4>
<p>that said, I see the following difficulty: <code>mem_categorization.rs</code> wants to build an <code>UpvarId</code> to store in <code>NoteClosureEnv</code>/<code>NoteUpvarRef</code>. At that point, we don't have any path information available (indeed, we make use of <code>cmt_</code> to deduce the path information). We can't straightforwardly backpatch the path either, as the <code>cmt_</code> code starts from <code>Def::Upvar</code>. I guess we could add an optional path throughout, but this feels pretty icky.</p>
<p>Technically, we can start with an empty path (i.e. <code>(x, [])</code> means "here we're capturing <code>x</code> in its entirety") and then refine the path in <code>upvar.rs</code>. One problem here is that later calls to the <code>cmt_</code> functions will still start from the <code>Def::Upvar</code>. I suppose we could use a <code>adjust_upvar_captures</code> as a side-table in <code>cat_upvar</code> in later calls to the <code>cmt_</code> code? Nope. When looking at a <code>Def::Upvar</code>, we have no way of telling what the replacement <code>UpvarId</code> is.</p>



<a name="163026131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/163026131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#163026131">(Apr 10 2019 at 17:32)</a>:</h4>
<p>Wondering if there's a modifying visitor for the HIR...</p>



<a name="163026357"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/163026357" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#163026357">(Apr 10 2019 at 17:34)</a>:</h4>
<p>other than <code>hair/cx</code> that is :-)</p>



<a name="163083430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/163083430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#163083430">(Apr 11 2019 at 09:15)</a>:</h4>
<p>huh, I can't find existing code that modifies the HIR. AFAIU, modifying the HIR is needed for commuting the path of an upvar access within the closure body, i.e. convert:</p>
<div class="codehilite"><pre><span></span><span class="kd">let</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">X</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">y</span><span class="p">,</span><span class="w"> </span><span class="n">z</span><span class="w"> </span><span class="p">};</span><span class="w"></span>
<span class="c1">// Capture x</span>
<span class="kd">let</span><span class="w"> </span><span class="n">cl</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">||</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">bar</span><span class="p">(</span><span class="o">&amp;</span><span class="n">env</span><span class="p">.</span><span class="mf">0.</span><span class="n">y</span><span class="p">);</span><span class="w"></span>
<span class="p">};</span><span class="w"></span>
</pre></div>


<p>to</p>
<div class="codehilite"><pre><span></span><span class="kd">let</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">X</span><span class="w"> </span><span class="p">{</span><span class="n">y</span><span class="p">,</span><span class="w"> </span><span class="n">z</span><span class="p">};</span><span class="w"></span>
<span class="c1">// Capture x.y</span>
<span class="kd">let</span><span class="w"> </span><span class="n">cl</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">||</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">bar</span><span class="p">(</span><span class="o">&amp;</span><span class="n">env</span><span class="p">.</span><span class="mi">0</span><span class="p">);</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="163407420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/163407420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#163407420">(Apr 15 2019 at 19:10)</a>:</h4>
<p>FWIW, updated the <a href="https://paper.dropbox.com/doc/Upvar-Paths--Aa7C6aefXL6RNSXHuUu8jncVAg-PNRgk22ryKq1n3Wq3FXAO" target="_blank" title="https://paper.dropbox.com/doc/Upvar-Paths--Aa7C6aefXL6RNSXHuUu8jncVAg-PNRgk22ryKq1n3Wq3FXAO">paper doc</a> with notes on what I worked on / found out this week</p>



<a name="163409685"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/163409685" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#163409685">(Apr 15 2019 at 19:41)</a>:</h4>
<p><span class="user-mention" data-user-id="127677">@ange</span> we never mutate the HIR, we just built up "Side tables"</p>



<a name="163410727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/163410727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#163410727">(Apr 15 2019 at 19:54)</a>:</h4>
<p>Yah, see the "Capture paths of an Upvar, not the variable itself" section in the paper doc (unfortunately only allows two levels of headings so can't link directly)</p>



<a name="163410771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/sync%202019-04-09/near/163410771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ange <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/sync.202019-04-09.html#163410771">(Apr 15 2019 at 19:55)</a>:</h4>
<p>Will try to clean up the doc before tomorrow's sync up</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>